home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
e
/
misc.save
/
000056_scottac@nb.sympatico.ca_Fri Jan 19 11:23:56 2007.msg
< prev
next >
Wrap
Internet Message Format
|
2011-07-03
|
3KB
Path: reader2.panix.com!reader1.panix.com!panix!bloom-beacon.mit.edu!news2.wam.umd.edu!elk.ncren.net!newsflash.concordia.ca!News.Dal.Ca!ursa-nb00s0.nbnet.nb.ca!53ab2750!not-for-mail
From: "Scott Caissie" <scottac@nb.sympatico.ca>
Newsgroups: comp.protocols.kermit.misc
Subject: fixed character length with a non-consistant variable length
Lines: 42
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
Message-ID: <qw_rh.2669$1x.45556@ursa-nb00s0.nbnet.nb.ca>
Date: Fri, 19 Jan 2007 07:34:46 GMT
NNTP-Posting-Host: 156.34.63.9
X-Complaints-To: abuse@aliant.net
X-Trace: ursa-nb00s0.nbnet.nb.ca 1169192086 156.34.63.9 (Fri, 19 Jan 2007 03:34:46 AST)
NNTP-Posting-Date: Fri, 19 Jan 2007 03:34:46 AST
Organization: Aliant Internet
Xref: panix comp.protocols.kermit.misc:15627
I'm looking for a "simplier" way to force a variable of mixed character
length to a fixed character length.
For this project, I always want to have MORE characters than the actual
variable's size. So I'm trying to add in spaces. Thats my problem. Making it
less is easy.
Example from my project:
.q_formatted := \fstripx(\fsubstr(\m(getdata),1,13),\9)
The saved value has up to 13 characters, but mostly it has less.
For testing purposes, I'm trying to fixate the saved character length to 20.
The reasoning for doing this, is that I want to save a multitude of values
into 1 entry within an Array. And by it's character position, other macros
can determine what the value is represents.
The end result would be:
Characters 1-20 = First value
Characters 21-25 = Second value
Characters 26-30 = Thrid value
Characters 31-32 = Forth value
Characters 33-36 = Fifth value
Characters 37-40 = Sixth value
Characters 41-44 = Seveth value
I can technically do it, but I'm sure I'm going about it the wrong way.
Below is an example I just typed up. It wasn't tested yet.
All it does (or should do), is check for the length difference and use the
repeat function to add in spaces for the remainder.
.q_formatted := \fstripx(\fsubstr(\m(getdata),1,13),\9)
if < \flength(\fstripx(\fsubstr(\m(getdata),1,13),\9)) 20 {
.q_formatted :=
\m(q_formatted)\frepeat(\32,\feval(20-\flength(\fstripx(\fsubstr(\m(getdata),1,13),\9))))
}
* I'm not at a computer which has the K95 system on it right now so that
example I just gave might have improper syntax. I can't recall if its
\frepeat(text,integer) or \frepeat(integer,text).
- Scott